import type { ProfileDetail, updateProfileParams } from '@/types/profile'
import { request, service } from '@/utils/request'

/**
 * 获取个人信息
 */
export const getMemberProfileAPI = () => {
  return request<ProfileDetail>('/member/profile', 'GET')
}
/**
 * 修改个人信息
 */
export const updateMemberProfileAPI = (data: updateProfileParams) => {
  return request<ProfileDetail>('/member/profile', 'PUT', data)
}
/**
 * 修改头像
 */
export const updateMemberAvatarAPI = (data: string) => {
  return service.upload('/member/profile/avatar', {
    name: 'file',
    filePath: data,
  })
}
